#!/bin/bash

echo "=== Testing New Client with Database Isolation ==="

# Create a test script for interactive mode
cat > /tmp/new_client_test_commands << 'EOF'
SHOW TABLES;
USE testdb2;
SHOW TABLES;
USE gudb;
SHOW TABLES;
quit
EOF

echo "Running commands with NEW client in single interactive session:"
echo "---"
cat /tmp/new_client_test_commands
echo "---"

# Run all commands in a single interactive session with new client
./bin/gu_new -h localhost -P 7777 -u admin -i < /tmp/new_client_test_commands

# Cleanup
rm -f /tmp/new_client_test_commands

echo "=== New Client Test Complete ==="